{extend name="public:base"}
{block name='css'}
<link href="__PUBLIC__/css/plugins/iCheck/custom.css" rel="stylesheet">
{/block}
{block name="js"}
<script type="text/javascript">
    function del(self, id){
        if ($(self).hasClass('ed')) {
            return false;
        }

        layer.confirm('真的要删除吗？删除后将无法找回！', {
            btn: ['确定','取消'] //按钮
        }, function(){
            myRequestRefresh(self, "{:url('del')}", {id:id});
        }, function(){

        });
    }

    function confirmReply(self, id){
        if ($(self).hasClass('ed')) {
            return false;
        }

        layer.prompt({title: '请回复内容，并确认', formType: 2}, function(text, index){
            layer.close(index);
            myRequestRefresh(self, "{:url('reply')}", {id:id,reply:text});
        });
    }
</script>
{/block}
{block name='body'}
<body class="gray-bg">
    <div class="wrapper wrapper-content animated fadeInRight">

        <div class="row">
            <div class="col-sm-12">
                <div class="ibox float-e-margins">
                    <div class="ibox-title">
                        <h5>评价管理</h5>
                    </div>
                    <div class="ibox-content">
						<div class="row">
							<form name="form" action="{:url('index')}" method="get">
                                <div class="col-sm-3 m-b-xs">
                                    <div class="input-group">
                                        <input type="text" name="keywords" value="{:input('keywords')}" placeholder="商品名称/用户姓名/用户手机号/评价内容" class="input-sm input-sm form-control"> <span class="input-group-btn">
                                        <button type="submit" class="btn btn-sm btn-primary"> 搜索</button> </span>
                                    </div>
                                </div>
							</form>
                        </div>
                        <table class="table table-hover">
                            <thead>
                                <tr>
                                    <th>商品名称</th>
                                    <th>用户</th>
                                    <th>评分</th>
                                    <th>内容</th>
                                    <th>回复内容</th>
                                    <th>评价时间</th>
                                    <th>操作</th>
                                </tr>
                            </thead>
                            <tbody>
								{volist name="list" id="li"}
                                <tr>
                                    <td>{$li.g_title}</td>
                                    <td>{$li.name} | {$li.tel}</td>
                                    <td><div style="max-width: 79px;overflow-x: hidden;padding: 0;"><img src="__PUBLIC__/img/star.png" style="margin-left: {php}echo (5-$li['star'])*-16;{/php}px;"/></div></td>
                                    <td>{$li.content}</td>
                                    <td>
                                        {gt name='li.reply_time' value='0'}
                                        {$li.reply}
                                        {else/}
                                        <a href="javascript:;" onclick="confirmReply(this, {$li.id})" class="btn btn-danget btn-xs">回复</a>
                                        {/gt}
                                    </td>
                                    <td>{$li.add_time|date="Y-m-d H:i:s" , ###}</td>
                                    <td>
	                                    <a href="javascript:;" onclick="return del(this, {$li.id});" class="btn btn-danger btn-xs delete"><i class="fa fa-trash-o"></i> 删除</a>
									</td>
                                </tr>
								{/volist}
                            </tbody>
							<tfoot>
								<tr>
                                    <td colspan="9">{$list->render()}</td>
                                </tr>
							</tfoot>
                        </table>
                    </div>
                </div>
            </div>
        </div>
        
    </div>
    
</body>
{/block}
